package com.samsung.service.impl.vote;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.samsung.dao.vote.VoteHistoryMapper;
import com.samsung.dto.vote.VoteReportDto;
import com.samsung.service.vote.VoteReportService;


@Service("voteReportService")
public class VoteReportServiceImpl implements VoteReportService {
	@Autowired
	private VoteHistoryMapper voteHistoryMapper;

	/**
	 * 根据投票主题统计子项数量
	 */
	@Override
	public List<VoteReportDto> statByTopic(String topicId) {
		return voteHistoryMapper.statByTopic(topicId);
	}
	
	/**
	 * 计算某投票主题有多少用户参与投票
	 */
	@Override
	public Integer getVoterCountByTopic(String topicId) {
		return voteHistoryMapper.getVoterCountByTopic(topicId);
	}

	
	
}
